package com.xinsoft.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.math.BigDecimal;

import com.xinsoft.validator.group.AddGroup;
import com.xinsoft.validator.group.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;

/**
 * 盘点方案明细
 *
 * @TableName scm_inventory_plan_item
 */
@TableName(value = "scm_inventory_plan_item")
@Data
public class ScmInventoryPlanItem implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 盘点方案id
     */
    private Integer inventoryPlanId;

    /**
     * 物料ID
     */
    @NotNull
    private Integer materialId;

    /**
     * 库存ID
     */
    private Integer stockId;

    /**
     * 所在仓库ID
     */
    @NotNull
    private Integer warehouseId;

    /**
     * 所在库位ID
     */
    private Integer warehItemId;

    /**
     * 库存批次
     */
    private String batchNo;

    /**
     * 系统数量
     */
    private BigDecimal systemCount;

    /**
     * 辅助单位系统数量
     */
    private BigDecimal systemCountSupport;

    /**
     * 实际盘点数量
     */
    @NotNull(message = "实际盘点数量不能为空", groups = UpdateGroup.class)
    private BigDecimal checkCount;

    /**
     * 辅助单位实际盘点数量
     */
    @NotNull(message = "辅助单位实际盘点数量不能为空", groups = UpdateGroup.class)
    private BigDecimal checkCountSupport;

    /**
     * 盘盈盘亏数量
     */
    @NotNull(message = "盘盈盘亏数量不能为空", groups = UpdateGroup.class)
    private BigDecimal profitLossCount;

    /**
     * 辅助单位盘盈盘亏数量
     */
    @NotNull(message = "辅助单位盘盈盘亏数量不能为空", groups = UpdateGroup.class)
    private BigDecimal profitLossCountSupport;

    /**
     * 记录扫码条码id及数量
     */
    private String qrIdCount;

    /**
     * 辅助单位
     */
    private Integer supportUom;

    /**
     * 换算系数
     */
    @Positive(message = "换算系数只能是正数（大于0）", groups = {AddGroup.class, UpdateGroup.class})
    private BigDecimal convCoefficient;

    /**
     * 条码id
     */
    @TableField(exist = false)
    private String qrId;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}